<?php

/**
 * +------ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER * ---------+
 * +----------------------------------------------------------------------------+
 * | PHPKiisf - Keep It in Simple Framework										|
 * | Version 1.0																|
 * | Copyright (C) <2013>  Mario Cezzare <mcezzare@gmail.com>					|
 * | Blog: http://mcezzare.blogspot.com.br										|
 * |																			|
 * | This program is part of PHPKiisf, and is free software: you can			|
 * | redistribute it and/or modify it under the terms of the GNU 				|
 * | General Public License as published by										|
 * | the Free Software Foundation, either version 3 of the License, or			|
 * | (at your option) any later version.										|
 * |																			|
 * | This program is distributed in the hope that it will be useful,			|
 * | but WITHOUT ANY WARRANTY; without even the implied warranty of				|
 * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the				|
 * | GNU General Public License for more details.								|
 * | You should have received a copy of the GNU General Public License			|
 * | along with this program.  If not, see <http://www.gnu.org/licenses/>.		|
 * +----------------------------------------------------------------------------+
 * | Author : <Mario Cezzare Angelicola Chiodi> <mcezzare@gmail.com>			|
 * +----------------------------------------------------------------------------+
 * | Contributors																|
 * |																			|
 * +----------------------------------------------------------------------------+
 *
 */
/**
 * @package	Templates
 * @access	public
 * @since	2013-03-08
 * @author	Mario Cezzare <mcezzare@gmail.com>
 */

/**
 * DESCRIPTION
 *
 *
 *
 */
class config_template extends base_template {

    public static $name_file;
    public static $section_name = "Configuration";
    public static $params = array();

    public function __construct() {
	self::init();
    }

    public static function init() {
	self::$name_file = TEMPLATES_DIR . "/pages/config";
	parent::$name_file = self::$name_file;
	parent::$section_name = self::$section_name;
	self::_load();
    }

    /**
     * [load description]
     *
     * @return [type]      [description]
     */
    public static function _load() {
	self::$public_dir = sprintf("%sskins/%s", TEMPLATES_DIR, self::$skin);
	$template_config = sprintf("%s", self::$name_file . INCLUDE_EXTENSION);

	if (utils::check_template($template_config)) {
	    require_once $template_config;
	    return;
	} else {
	    $message = utils::prepare_message(
			    array(
				"MSG_TYPE" => "ERROR",
				"OPERATION" => "CONFIG_HOME_TEMPLATE NOT_FOUND",
				"DETAIL" => "called from " . __CLASS__ . " looking for $template_config . ",
			    )
	    );
	    utils::inform_user($message);
	    return;
	}
    }

}

//load the page
if (spl_autoload_register('config_template::init')) {
    config_template::init();
}
?>
